#define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
#include <vector>
#include <iomanip>
#include <random>
#include <algorithm>

const double EPSILON = 1e-9;


struct Point{
    double x,y;
};

class ArcSegmentIntersection{
public:
    ArcSegmentIntersection();

    void GenerateRandomArc();

    Point GenerateRandomPoint();

    Point ReflectPoint(const Point& p);

    std::vector<Point> intersect(const Point& p1,const Point& p2);

    double CalculateError(const Point& intersection);

    void RunTests(int numtests);

private:
    Point center;
    double radius;
    double start_angle,end_angle;
    Point mid_point;


    std::mt19937 gen;
    std::uniform_real_distribution<> dist;
    std::uniform_real_distribution<> angle_dist;

    bool IsOnArc(const Point&p);
};
